import request from '@/utils/request'

export function getNews(admin_id, token) {
  return request({
    url: '/_adminNews/list',
    method: 'post',
    data: {
      admin_id,
      token
    }
  })
}

export function createNews(data) {
  return request({
    url: '/_adminNews/add',
    method: 'post',
    headers: {
      'Content-Type': 'multipart/form-data'
    },
    data
  })
}

export function updateNews(data) {
  return request({
    url: '/_adminNews/edit',
    method: 'post',
    headers: {
      'Content-Type': 'multipart/form-data'
    },
    data
  })
}

export function deleteNews(admin_id, token, news_id) {
  return request({
    url: '/_adminNews/delete',
    method: 'post',
    data: {
      admin_id,
      token,
      news_id
    }
  })
}
